﻿using EFModel;
using IServices;
using Microsoft.AspNetCore.Mvc;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Y2.Filters;

namespace Y2.Controllers
{
    [LoginFilter]
    public class major_changeController : Controller
    {
        private readonly Imajor_change he;

        public major_changeController(Imajor_change he)
        {
            this.he = he;
        }

        public IActionResult major_change()
        {
            return View();
        }
        public IActionResult major_changeInsert(int? id)
        {
            ViewBag.huf_id = id;
            return View();
        }
        //人力资源通过查询
        public async Task<IActionResult> Query(int currentPage, int pageSize)
        {
            return Content(JsonConvert.SerializeObject(await he.Quer(currentPage, pageSize)));
        }
        //人力资源查询
        public async Task<IActionResult> Quers(int id)
        {
            return Content(JsonConvert.SerializeObject(await he.Quers(id)));
        }
        //薪酬标准查询
        public async Task<string> Querse()
        {
            return await he.Querse();
        }
        //调动添加
        public async Task<int> Insert(major_change major_)
        {
            return await he.Insert(major_);
        }
        //调动通过人力资源修改
        public async Task<int> UpdateTo(human_file _File)
        {
            return await he.UpdateTo(_File);
        }
        //人力资源机构职位变更
        public async Task<int> UpdateDd(human_file _File)
        {
            return await he.UpdateDd(_File);
        }
        //人力资源通过查询
        public async Task<IActionResult> QuerSso(human_file _File, int currentPage, int pageSize)
        {
            return Content(JsonConvert.SerializeObject(await he.QuerSso(_File, currentPage, pageSize)));
        }
    }
}
